Skip to content

Add netsim_args to cvd load config and plumb to launcher#2648

Open
rmuthiah wants to merge 1 commit into
google:mainfrom
rmuthiah:add-netsim-args-to-cvd-load
Open

Add netsim_args to cvd load config and plumb to launcher#2648
rmuthiah wants to merge 1 commit into
google:mainfrom
rmuthiah:add-netsim-args-to-cvd-load

Conversation

@rmuthiah
Copy link
Copy Markdown
Collaborator

@rmuthiah rmuthiah commented Jun 3, 2026

  • Update load_config.proto to include netsim_args in EnvironmentSpecification and EnvironmentOptions.
  • Update launch_cvd_parser.cpp to generate --netsim_args flag from the proto.
  • Regenerate Go proto code.
  • Add unit test to flags_parser_test.cc.

Generated by Jetski
Bug: b/447440168

- Update load_config.proto to include netsim_args in EnvironmentSpecification and EnvironmentOptions.
- Update launch_cvd_parser.cpp to generate --netsim_args flag from the proto.
- Regenerate Go proto code.
- Add unit test to flags_parser_test.cc.

TAG=agy
CONV=1de71887-825c-459d-a0c4-0168b1189286
@rmuthiah rmuthiah requested a review from cjreynol June 3, 2026 00:42
@rmuthiah rmuthiah enabled auto-merge June 3, 2026 18:28
@rmuthiah rmuthiah requested a review from Databean June 3, 2026 18:28
@rmuthiah rmuthiah disabled auto-merge June 3, 2026 18:28
optional Common common = 4;
optional bool netsim_bt = 5;
optional bool netsim_uwb = 6;
optional string netsim_args = 7;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might make more sense as a repeated string netsim_args, so that we don't have to deal with users trying to escape whitespace in this string.

Unfortunately the internal --netsim_args argument to assemble_cvd already is based on naive string splitting. This is an implementation detail we can fix later, but we should aspire to have a more sensible public API as it will be harder to change later. To make the behavior more predictable, the launch_cvd_parser.cpp implementation should introduce the whitespace to create the netsim_args flag, and error if the user-provided value has any whitespace. We can lift that restriction later.

Then again, this probably makes life slightly more difficult for all the callers specifying override flags for netsim_args...

Same concern applies for EnvironmentOptions below.

EXPECT_TRUE(ParseJsonString(json_text, json_configs))
<< "Invalid Json string";
auto serialized_data = LaunchCvdParserTester(json_configs);
EXPECT_TRUE(serialized_data.ok()) << serialized_data.error().Trace();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: this can use EXPECT_THAT(serialized_data, IsOk())

MATCHER(IsOk, "an ok result") {
auto& result = arg;
if (!result.ok()) {
*result_listener << "which is an error result with trace: "
<< result.error().Trace();
return false;
}
return true;
}

optional Common common = 4;
optional bool netsim_bt = 5;
optional bool netsim_uwb = 6;
optional string netsim_args = 7;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also came across go/netsim-args-oxygen which covers a time we talked about this before. I vaguely remember that either @jemoreira or I made the argument that exposing netsim_args opened the possibility of mutually contradictory config settings, e.g.

{
  "netsim_bt": false,
  "netsim_args": "-bt=true"
}

(not that any such -bt=true flag exists)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was actually Ram's position, we were just the ones in the meeting because of different time zones.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants